package com.hjy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hjy.pojo.SysRoleUser;
import com.hjy.pojo.SysUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysRoleUserMapper extends BaseMapper<SysRoleUser> {

    @Select("SELECT user_id FROM sys_role_user WHERE role_id = #{roleId}")
    List<Integer> getUserIdListByRoleId(@Param("roleId") int roleId);

    @Select("SELECT role_id FROM sys_role_user WHERE user_id = #{userId}")
    List<Integer> getRoleIdListByUserId(@Param("userId") int userId);
}
